#ifndef STUDENT_INTERFACE_H
#define STUDENT_INTERFACE_H

#include "constants.h"
#include "double_list.h"
#include "status_enum.h"

/**
 * Enumeration for gender.
 */
typedef enum
{
        MALE,                /** Male   */
        FEMALE,              /** Female */
        OTHER,               /** Other  */
        GENDER_NOT_SPECIFIED /** Not specified */
} gender_t;

/**
 * Structure to hold student information.
 */
typedef struct
{
        char id[MAX_ID_SIZE];     /** id            */
        char name[MAX_NAME_SIZE]; /** name          */
        gender_t gender;          /** gender        */
        char dob[MAX_DOB_SIZE];   /** date of birth */
} student_info_t;
/**

 * Node structure for student information in a linked list.
 */
typedef struct
{
        student_info_t info;   /** student information   */
        struct list_head list; /** list node for linking */
} student_node_t;

/**
 * Interface for student management operations.
 */
typedef struct
{
        status_t (*add_student_fn)(const student_info_t *info);

        status_t (*delete_student_id_fn)(const char *id,
                                         student_info_t *info);
        status_t (*delete_student_name_fn)(const char *name,
                                           student_info_t *info);

        status_t (*update_student_fn)(const student_info_t *info);

        status_t (*query_student_id_fn)(const char *id,
                                        student_info_t *info);

        status_t (*query_student_name_fn)(const char *name,
                                          student_info_t *info);

        status_t (*get_all_students_fn)(student_info_t **students,
                                        size_t *count);
} student_management_interface_t;

/**
 * Interface for student event handling.
 */
typedef struct
{
        void (*on_student_added_fn)(const student_info_t *student_info);
        void (*on_student_deleted_fn)(const student_info_t *student_info);
        void (*on_student_updated_fn)(const student_info_t *student_info);
        void (*on_student_query_fn)(const student_info_t *student_info);
} student_event_interface_t;

/**
 * Combined student interface, including management and event interfaces.
 */
typedef struct
{
        student_management_interface_t management; /** Management interface    */
        student_event_interface_t event;           /** Event handling interface*/
} student_interface_t;

void student_interface_init(student_interface_t *interface);

#endif /* STUDENT_INTERFACE_H */
